const http =  require('http');
const fs = require('fs');
const path = require('path');
const querystring = require('querystring');

let staticServer = require('./02-staticservice');

http.createServer((req,res) => {
    if(req.url === '/favicon.ico'){
        res.end();
        return;
    }
    staticServer(req, res,path.join(__dirname,'static'))

}).listen(8080,() => {
    console.log('running...');
})